﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Inovout.Data.Redis
{
    public abstract class RedisCommandResult
    {
        public object Content { get; internal set; }
        public bool IsCompleted { get; set; }

        internal abstract void SetContent(object content);

    }
    public class RedisCommandResult<T> : RedisCommandResult
    {
        public RedisCommandScript CommandScript { get; private set; }
        public RedisCommandResult(RedisCommandScript commandScript)
        {
            CommandScript = commandScript;
            commandScript.CommandResult = this;
        }
        internal override void SetContent(object content)
        {
            Content = content;
            IsCompleted = true;
        }
        public T Conent { get; internal set; }
    }
}
